﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SM2TestRunner;

namespace SM2SetupSearch
{
    public class SetupSearch
    {
        public const string MANUALENTRY = "ManualEntry";
        public const string QUERYBUILDER = "QueryBuilder";
        public const string BULKUPLOAD = "BulkUpload";

        public const string DATES = "dates";
        public const string LANGUAGES = "languages";
        public const string COUNTRIES = "countries";

        #region SearchSetup

        //Create a new Manual Entry search
        public static void NewSearchManualEntry()
        {
            string strSearchKeyword_NewSearchManualEntrye = TestDispatcher.TEST_PARAMETER.get("SearchKeyword_NewSearchManualEntry");
            string strSelectedProfileName_NewSearchManualEntry = TestDispatcher.TEST_PARAMETER.get("SelectedProfileName_NewSearchManualEntry");
            Search.NewSearchManualEntry(strSelectedProfileName_NewSearchManualEntry, strSearchKeyword_NewSearchManualEntrye);
        }

        //Create a new Query Builder search
        public static void NewSearchQueryBuilder()
        {
            string strSearchKeyword_NewSearchManualEntrye = TestDispatcher.TEST_PARAMETER.get("SearchKeyword_NewSearchManualEntry");
            string strSelectedProfileName_NewSearchManualEntry = TestDispatcher.TEST_PARAMETER.get("SelectedProfileName_NewSearchManualEntry");
            Search.NewSearchQueryBuilder(strSelectedProfileName_NewSearchManualEntry, strSearchKeyword_NewSearchManualEntrye);
        }

        //Create new search(es) using Bulk Upload
        public static void NewSearchBulkUpload()
        {
            string strSearchKeyword_NewSearchManualEntrye = TestDispatcher.TEST_PARAMETER.get("SearchKeyword_NewSearchManualEntry");
            string strSelectedProfileName_NewSearchManualEntry = TestDispatcher.TEST_PARAMETER.get("SelectedProfileName_NewSearchManualEntry");
            Search.NewSearchBulkUpload(strSelectedProfileName_NewSearchManualEntry, strSearchKeyword_NewSearchManualEntrye);
        }

        //Not available yet
        public static void BulkEditSearch()
        {

        }

        //Edit Search by updating keyword
        public static void EditSearch()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strSearch = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release1";
            string strSearch = "thisisdebug";
            string strNewSearch = "thisisdebug edited " + Utilities.StringUtil.getTime();
            Search.EditSearch(strProfileName, strSearch, strNewSearch);
        }

        //Delete Search base on the name of keyword
        public static void DeleteSearch()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strSearch = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release1";
            string strSearch = "thisisdebug";
            Search.DeleteSearch(strProfileName, strSearch);
        }

        //Select a search then set it to Enable if it's currently set as Disable
        public static void SetEnableSearch()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strSearch = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release2";
            string strSearch = "thisisdebug";
            Search.SetEnableSearch(strProfileName, strSearch);
        }

        //Select a search then set it to Disable if it's currently set as Enable
        public static void SetDisableSearch()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strSearch = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release2";
            string strSearch = "thisisdebug";
            Search.SetDisableSearch(strProfileName, strSearch);
        }

        //Add a quick search by providing the keyword and click Add button
        public static void AddQuickSearch()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strQuickKeyword = TestDispatcher.TEST_PARAMETER.get("Quick Keyword");
            string strProfileName = "copy_release2";
            string strQuickKeyword = "thisisdebug";
            Search.AddQuickSearch(strProfileName, strQuickKeyword);
        }

        //Run Historical by choosing date range and click Apply
        public static void RunHistorical()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strStartDate = TestDispatcher.TEST_PARAMETER.get("Search");
            //string strEndDate = TestDispatcher.TEST_PARAMETER.get("Search");
            //string strConfirm = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release2";
            string strStartDate = "6/6/2011";
            string strEndDate = "6/8/2011";
            string strConfirm = "yes";
            Search.RunHistorical(strProfileName, strStartDate, strEndDate, strConfirm);
        }

        //Set Global Excludes by add new phrase of word
        public static void GlobalExcludes()
        {
            //string strProfileName = TestDispatcher.TEST_PARAMETER.get("Profile Name");
            //string strExcludedWords = TestDispatcher.TEST_PARAMETER.get("Search");
            string strProfileName = "copy_release2";
            string strExcludedWords = "SM2Expression";
            Search.GlobalExcludes(strProfileName, strExcludedWords);
        }

        #endregion

        #region Notifications
        
        //Assign & remove email
        public static void ManageEmailAddressOnContactList()
        {

        }

        //Set on/off and time to send
        public static void ConfigDailyReport()
        {

        }

        //Set on/off
        public static void ConfigWeeklyReport()
        {

        }

        //Assign & remove email
        public static void ManageEmailDailyReport()
        {

        }

        //Assign & remove email
        public static void ManageEmailWeeklyReport()
        {

        }

        //Assign & remove email
        public static void ManageEmailNotifications()
        {

        }
        #endregion
    }
}
